<!DOCTYPE html>
<html>
<head>
<base href="${basePath}">
<meta charset="UTF-8">
<title>地域管理</title>
$!{include("import_js_css.html")}
<link rel="stylesheet" type="text/css" href="/yueyoga_all2014/app/admin/resources/css/basic.css" />
</head>
<body>
	$!{include("header.html")}
	<div class="container menu_all">
		<div class="tabbable tabs-left" id="div_ul_tab">
			$!{include("system_tab.html")}
			<div class="tab-content">
				<div class="tab-pane active" id="panel-task">
					<div>
						<form class="form-horizontal" role="form" name="taskForm"
							action="yueyogaAdmin/findAreaList.jhtml" method="post">
							<div class="form-group">
								<div class="panel-basic-search">
									<label for="inputName" class="col-sm-1 control-label">名　称</label>
									<div class="col-sm-3">
										<input type="text" class="form-control" name="name" id="inputName" value="${name}">
									</div>
									<label for="inputProvince" class="col-sm-1 control-label">所在省</label>
									<div class="col-sm-3">
										<!--#var(Area area,List<Area> provinces, List<Area> citys, List<Area> areas, List<Area> domains)-->
										<select id="inputProvince" data-live-search="true"
											class="selectpicker show-tick" data-width="100%" name="provinceId">
											<option value="">全部</option>
											<!--#foreach(area in provinces)-->
												<option value="${area.areaId}">${area.name}</option>
											<!-- #end -->
										</select>
									</div>
									<br /> <br />
									<label for="inputCity" class="col-sm-1 control-label">所在市</label>
									<div class="col-sm-3">
										<!-- #var(Area provinceArea) -->
										<select id="inputCity" data-live-search="true"
											class="selectpicker show-tick" data-width="100%" name="cityId">
											<option value="">全部</option>
											<!--#foreach(area in citys)-->
												<option value="${area.areaId}">${area.name}</option>
											<!-- #end -->
										</select>
									</div>
									<label for="inputArea" class="col-sm-1 control-label">所在区</label>
									<div class="col-sm-3">
										<!-- #var(Area cityArea) -->
										<select id="inputArea" data-live-search="true"
											class="selectpicker show-tick" data-width="100%" name="areaId">
											<option value="">全部</option>
											<!--#foreach(area in areas)-->
												<option value="${area.areaId}">${area.name}</option>
											<!-- #end -->
										</select>
									</div>
									<br /> <br />
									
									<input type="hidden" name="pageNo" id="hidPageNo" />
									<div class="panel-btn-search" style="margin-right:38px;">
										<button type="submit" class="btn btn-default btn-ade-default" style="margin-right:60px;">搜索</button>
									</div>
								</div>
							</div>
						</form>
					</div>
				</div>
			</div>
			<div class="div_search_result clear">
				$!{include("area_list.html")}
			</div>
		</div>
	</div>
</body>
</html>
<script type="text/javascript">
//省
$("#inputProvince").change(function() {
	var parentId = $(this).val();
	$.post(
		"yueyogaAdmin/subArea.jhtml",
		{"level": "1", "parentId": parentId},
		function(response) {
			var sub = document.getElementById("inputCity");
			var res = eval("(" + response + ")");
			var id = null;
			var name = null;
			var option = null;
			sub.options.length=0;
			option = new Option("全部", "");
			sub.options.add(option);
			for(var i=0;i<res.items.length;i++) {
				id = res.items[i].areaId;
				name = res.items[i].name;
				option = new Option(name, id);
				sub.options.add(option);
			}
			var sub1 = document.getElementById("inputArea");
			sub1.options.length=0;
			option = new Option("全部", "");
			sub1.options.add(option);
		}
	);
});

//市
$("#inputCity").change(function() {
	var parentId = $(this).val();
	$.post(
		"yueyogaAdmin/subArea.jhtml",
		{"level": "2", "parentId": parentId},
		function(response) {
			var sub = document.getElementById("inputArea");
			var res = eval("(" + response + ")");
			var id = null;
			var name = null;
			var option = null;
			sub.options.length=0;
			option = new Option("全部", "");
			sub.options.add(option);
			for(var i=0;i<res.items.length;i++) {
				id = res.items[i].areaId;
				name = res.items[i].name;
				option = new Option(name, id);
				sub.options.add(option);
			}
		}
	);
});

$("#inputProvince").val('${provinceId}');
$("#inputCity").val('${cityId}');
$("#inputArea").val('${areaId}');
$("#inputEnable").val('${enable}');
</script>